<template>
  <!-- vue3可以没有根标签 -->
  <h3>姓名:{{name}}</h3>
  <h3>年龄:{{age}}</h3>
  <button @click="sayHello">点击一下</button>
</template>

<script>
  import {h} from 'vue'
  export default {
    name: 'App',
    setup(props) {
      let name = '张三'
      let age = 18

      function sayHello(){
        alert(`hello-${name}`)
      }

      return {
        name,
        age,
        sayHello
      }
      // 渲染函数
      //return ()=>{return h('h2','hello')}
    }
  }
</script>

